package com.xtxb.app.rmq.common;

import java.io.Serializable;
import java.nio.charset.StandardCharsets;
import java.util.UUID;

public class Topic implements Serializable {
    private String uuid;
    private String groupName;
    private String topic;
    private String tag;
    private String note;
    private String serverName;

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public String getServerName() {
        return serverName;
    }

    public void setServerName(String serverName) {
        this.serverName = serverName;
    }

    public static String generateUUID(Topic topic){
        return UUID.nameUUIDFromBytes((topic.getGroupName()+"_"+topic.getTopic()+"_"+topic.getTag()).getBytes(StandardCharsets.UTF_8)).toString();
    }
}
